<template>
<el-container id='app'>
  <el-header>Header</el-header>
  <el-container style='height: 800px;'>
    <el-aside>
      <asideNav @asideNav='asideNav'></asideNav>
    </el-aside>
    <el-main>
        <router-view></router-view>
    </el-main>
  </el-container>
</el-container>

</template>

<script>
import asideNav from './components/asideNav'
// https://gitee.com/gaojialong/carWeb.git
const navMap = new Map([
  ['品牌列表', 'carBrand'],
  ['车型列表', 'carType'],
  ['库存列表', 'carStock'],
  ['保险列表', 'carAssurance'],
  ['设备列表', 'carEquipment'],
  ['牌照列表', 'carLicense'],
  ['维修列表', 'carRepair'],
  ['违章列表', 'carPeccancy'],
  ['理赔列表', 'carPayment'],
  ['产品列表', 'carProduct'],
  ['会员等级类型', 'carMembershipgradetype'],
  ['会员等级', 'carEmbership'],
  ['用户列表', 'carUser'],
  ['充值记录', 'carRechargeRecord'],
  ['管家列表', 'carManager'],
  ['车检列表', 'carCheck'],
  ['代金券列表', 'carRoucher'],
  ['发放代金券', 'carIssueVoucher'],
  ['订单列表', 'carOrder'],
  ['退改规则列表', 'carRevesionRule'],
  ['服务合约管理', 'servicecontractManagement']
])

export default {
  name: 'App',
  components: {
    asideNav
  },
  data () {
    return {
    }
  },
  methods: {
    asideNav: function (data) {
      let mainSrc = navMap.get(data)
      if (typeof (mainSrc) !== 'undefined') {
        console.log(mainSrc)
        this.$router.push({name: mainSrc})
      }
    }
  }
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin: 0px;
}
.el-header, .el-footer {
  background-color: #B3C0D1;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.el-aside {
  background-color: #D3DCE6;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  color: #333;
  text-align: center;
  line-height: 160px;
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
</style>
